package com.hefei.blog.core.lucene;

import org.ansj.lucene6.AnsjAnalyzer;
import org.apache.lucene.analysis.Analyzer;

public class AnalyzerUtil {

	private static Analyzer analyzer;

	public static Analyzer getAnalyzer() {
		if (analyzer == null) {
			// 当为true时，分词器迚行最大词长切分 ；当为false时，分词器迚行最细粒度切
			//http://nlpchina.github.io/ansj_seg/
			analyzer = new AnsjAnalyzer(AnsjAnalyzer.TYPE.index_ansj);
		}
		return analyzer;
	}
}
